{% load account_tags %}
{% load url from future %}
{% load cache %}

{% comment %}
{% if request.user.is_authenticated %}
	<p class="navbar-text pull-left">Logged in as</p>
{% endif %}

{% cache 3600 content request.user request.path %}
{% endcomment %}

<ul class="nav pull-right">
	{% if request.user.is_authenticated %}
		<li class="dropdown">
			<a href="{% url "account_settings" %}">
				<i class="icon-fixed-width icon-user"></i> {% user_display request.user %} <b class="caret"></b>
			</a>
			<ul class="dropdown-menu">
				<li><a href="{% url "account_settings" %}"><i class="icon-fixed-width icon-cog"></i> Settings</a></li>
				<li><a href="{% url "account_password" %}"><i class="icon-fixed-width icon-refresh"></i> Change password</a></li>
				<li class="divider"></li>
				{% if request.user.is_staff %}
					<li><a href="{% url "admin-shell" %}"><i class="icon-fixed-width icon-list-alt"></i> Python shell</a></li>
					<li><a href="{% url "admin:index" %}"><i class="icon-fixed-width icon-dashboard"></i> Admin panel</a></li>
				{% endif %}
				<li class="divider"></li>
				<li><a href="{% url "account_logout" %}" id="nav-logout"><i class="icon-fixed-width icon-off"></i> Log out</a></li>
			</ul>
		</li>
	{% else %}
		<li><a href="{% url "account_login" %}" id="nav-login">Log in</a></li>
		{% if user.is_staff %}
		<li class="navbar-text">or</li>
		<li><a href="{% url "account_signup" %}" id="nav-signup">Sign up</a></li>
		{% endif %}
	{% endif %}
</ul>
